/*
 * HashRecordSerializer.h
 *
 *  Created on: Oct 26, 2012
 *      Author: m
 */

#ifndef HASHRECORDSERIALIZER_H_
#define HASHRECORDSERIALIZER_H_

#include <cstring>
#include "../../physical_layer/VariableStringSerializer.h"
#include "../../physical_layer/VariableSizeRecordSerializer.h"
#include "HashRecord.h"

class HashRecordSerializer : public physical::VariableSizeRecordSerializer<HashRecord>
{
private:
    static physical::VariableStringSerializer sm_stringSerializer;
    typedef physical::VariableStringSerializer::_T_ptr _str_ptr;

public:
    HashRecordSerializer();
    ~HashRecordSerializer();

    size_t serialize( const HashRecord &element, physical::byteStream block );
    size_t deserialize( const physical::byteStream block, HashRecord &element );
    size_t computeSize( const HashRecord &element );

    size_t serialize( const _T_ptr &elementPtr, physical::byteStream block );
    size_t deserialize( const physical::byteStream block, _T_ptr &elementPtr );
    size_t computeSize( const _T_ptr &elementPtr );
};

#endif /* HASHRECORDSERIALIZER_H_ */
